package com.patterns.java.strategy.demo2;

/**
 * 策略：
 * +
 * -
 * *
 *
 * @author 三多
 * @Time 2021/10/13
 */
public class StrategyDemo {
    public static void main(String[] args) {
        Context context = new Context(new AddOperation());
        System.out.println("3 + 4 = "+ context.executeOperation(3,4));
        context = new Context(new SubtractOperation());
        System.out.println("10 - 3 = "+ context.executeOperation(10,3));
        context = new Context(new MultiplyOperation());
        System.out.println("3 * 4 = "+ context.executeOperation(3,4));
    }
}
